<template>
  <div>
    <p>新闻分类的内容</p>
    <p>{{ num }}</p>
    <button @click="add">+1</button>
  </div>
</template>

<script>
export default {
  name: "newsType",
  beforeCreate() {
    console.log("创建前");
  },
  created() {
    console.log("创建后");
  },

  data() {
    return {
      num: 1,
    };
  },
  methods: {
    add() {
      this.num++;
    },
  },
  mounted() {
   
  },
};
</script>

<style>
</style>